using System;
using System.Windows.Forms;

using FreeFlow.Client;

namespace FreeFlow.WinFormsControls
{
	/// <summary>
	/// A button control.
	/// </summary>
	public class ButtonControl : Button, IFillable
	{
    /// <summary>
    /// Creates a new <see cref="ButtonControl"/> instance.
    /// </summary>
		public ButtonControl()
		{
    }

    #region IFillable Members

    /// <summary>
    /// Renders the button with static layout information using the specified field.
    /// </summary>
    /// <param name="field">Field.</param>
    public void Render(FreeFlow.Client.Field field)
    {
      Text = (field as ButtonField).Caption;
      FlatStyle = FlatStyle.System;
    }

    /// <summary>
    /// Fills the button with values from the specified field.
    /// </summary>
    /// <param name="field">Field.</param>
    public void Fill(FreeFlow.Client.Field field)
    {
    }

    /// <summary>
    /// Fills the field from the control.
    /// </summary>
    /// <param name="field">Field.</param>
    public void FillField(Field field)
    {
    }

    #endregion
  }
}
